package org.dwell.urlfilter.demo.test;


import org.dwell.urlfilter.demo.domain.CoreRole;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Jange on 2016/4/6.
 */
public class CoreRoleDB {

    private static List<CoreRole> roleList = new ArrayList<CoreRole>();

    static {
        roleList.add(new CoreRole("role000000001", "坚果角色"));
        roleList.add(new CoreRole("role000000002", "芒果角色"));
        roleList.add(new CoreRole("role000000003", "苹果角色"));
        roleList.add(new CoreRole("role000000004", "水果角色"));
        roleList.add(new CoreRole("role000000005", "橙子角色"));
    }

    public static List<CoreRole> getAll() {
        return roleList;
    }

    public static CoreRole getByRoleId(String roleId) {
        for (CoreRole coreRole : roleList) {
            if(coreRole.getRoleId().equalsIgnoreCase(roleId)) {
                return coreRole;
            }
        }

        return null;
    }
}
